package sort;

import org.junit.Test;

/**
 * Created by csmd on 2017/12/29.
 */
public class test {
    @Test
    public void test(){
        //测试冒泡排序
        int a[] ={1,22,0,11,3,44,5,66,7,88};
        for(int i = 0;i<a.length;i++){
            System.out.println("---"+a[i]);
            for(int j = 1;j<a.length-i;j++){
                if(a[j-1] > a[j]){
                    int m = a[j-1];
                    a[j-1] = a[j];
                    a[j] = m;
                }
            }
        }
        for(int i = 0;i<a.length;i++){
            System.out.println(a[i]);
//            1
//            3
//            5
//            7
//            22
//            44
//            66
//            88
        }
    }
    @Test
    public void test2(){
        //测试二分发查找
        int[] a = {1,2,4,11,23,45,56,66,666,777};
        int s = 2;
        test.demo(a,s);
    }
    public static void demo(int[] a, int s){
        int midId=0;
        int start  =0;
        int end = a.length - 1;
        midId = a.length/2;

//        while(start){
//
//        }
    }
    @Test
    public void test22(){
       System.out.println(21/2);

    }
}
